Xbasic

INET::FTPReceiveBinaryData Method

Syntax

.ReceiveBinaryData as L (BYREF Data as B, SourceFile as C)

Arguments

DataBinary

The binary data received.

SourceFileCharacter

The source file name.

Returns

resultLogical

Returns .t. if the operation succeed. Otherwise, returns .f.. If an error occurred, the INET::FTP CallResult property will contain more information.

Description

Receives the contents of a server file into a binary buffer.

Example

dim ftp as INET::FTP
ftp.UserName   = "Fred"
ftp.Password   = "Secret"
ftp.EnableSSL  = .t.
ftp.Host       = "ftp.myserver.com"
ftp.UsePassive = .t.

dim data as B

if ftp.ReceiveBinaryData(data,"target.csv", .f.) <> .t.
    ' error
    msg = ftp.callResult.error
    ...
end if